<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src='template.js'></script>
	<script type='text/html' id='template'>
		<h1>{{title}}</h1>
		{{each books as value}}
		<ul>
			<li>{{value}}</li>
		</ul>
		{{/each}}
	</script>
	<script>
		window.onload=function(){
			var data = {
				title:'图书信息',
				books:['三国演义','水浒传','西游记','红楼梦']
			}
			var html = template('template',data);
			document.body.innerHTML=html;
		}
	</script>
</head>
<body>
	
</body>
</html>